#pragma once

#include <vector>
#include "Sample.h"

/*
Actual vocoder implementation that deals only the vocoding aspect
*/
class VocoderImpl
{
public:
	VocoderImpl(void);
	~VocoderImpl(void);

	/*
	Create necessary buffers
	*/
	void Initialize(int windowLength, int bandCount, double volume, bool normalize, int samplingRate);

	/*
	Takes modulator and carrier sample, and puts vocoded output in vocoded Sample.
	Is using 3rd party vocoding implmentation found in VocoderBase module.
	*/
	void Vocode(short* modulator, short* carrier, Sample& vocoded);

private:
	void VocodeFFTdWindow(std::vector<double>& dModulator, 
						  std::vector<double>& dCarrierReal, 
						  std::vector<double>& dCarrierImag, 
						  std::vector<double>& dVocodedReal, 
						  std::vector<double>& dVocodedImag);

	Sample lastSample;

	int windowLength;
	int bandCount;
	double volume;
	bool normalize;
	int samplingRate;
};
